<template>
  <div>
    <div class="top">
      <router-link to="/dizhi"> <span>&lt;</span></router-link>
      <span>收货地址</span>
    </div>
    <div id="box">
      <div class="top1">
        <div>
          <p>雁塔区立人科技(高新六路西150米)</p>
          <p>陕西省/西安市/雁塔区</p>
        </div>
        <span>使用当前定位</span>
      </div>
      <div class="top2">
        <span class="iconfont">获取微信收货地址 </span>
        <span>&gt;</span>
      </div>
     <div class="top3">
          <van-address-edit
  
  show-postal
  show-delete
  show-set-default
  show-search-result
  :search-result="searchResult"
  :area-columns-placeholder="['请选择', '请选择', '请选择']"
  @save="onSave"
  @delete="onDelete"
  @change-detail="onChangeDetail"
/>
     </div>
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant';
export default {
 data() {
    return {
      // areaList,
      searchResult: [],
    };
  },
  methods: {
    onSave() {
      Toast('save');
    },
    onDelete() {
      Toast('delete');
    },
    onChangeDetail(val) {
      if (val) {
        this.searchResult = [
          {
            name: '黄龙万科中心',
            address: '杭州市西湖区',
          },
        ];
      } else {
        this.searchResult = [];
      }
    },
  },
};
</script>

<style scoped>
#box {
  background-color: rgb(242, 242, 243);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.1rem 0;
}
.top {
  height: 0.5rem;
  line-height: 0.5rem;
  font-size: 0.2rem;
  margin-left: 0.15rem;
}
.top span {
  margin-right: 1.2rem;
}
.top1,
.top2 ,
.top3 
{
  display: flex;
  background-color: white;
  padding: 0 0.1rem;
  justify-content: space-between;
  border-radius: 0.2rem;
  width: 3.3rem;
  margin: 0.05rem 0;
   align-items: center;
}
.top1 {
  height: 0.8rem;
  line-height: 0.2rem;
}
.top1 div {
  width: 1.3rem;
}
.top1 p:nth-child(1) {
  font-size: 0.14rem;
  font-weight: 600;
}
.top1 span {
  color: rgb(71, 255, 47);
  font-size: 0.14rem;
  font-weight: 600;
}
.top2 {
  height: .45rem;
   border-radius: 0.1rem;
}
</style>